2 Imports System
.Collections
.Generic
4 Imports Microsoft
.WindowsAzure
5 Imports Microsoft
.WindowsAzure
.Diagnostics
6 Imports Microsoft
.WindowsAzure
.ServiceRuntime
9 Inherits RoleEntryPoint
11 Public Overrides
Function OnStart() As Boolean
13 DiagnosticMonitor
.Start("DiagnosticsConnectionString")
15 ' For information on handling configuration changes
16 ' see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
17 AddHandler RoleEnvironment
.Changing
, AddressOf RoleEnvironmentChanging
19 Return MyBase
.OnStart()
23 Private Sub RoleEnvironmentChanging(ByVal sender
As Object, ByVal e
As RoleEnvironmentChangingEventArgs
)
25 ' If a configuration setting is changing
26 If (e
.Changes
.Any(Function(change
) TypeOf change Is RoleEnvironmentConfigurationSettingChange
)) Then
27 ' Set e.Cancel to true to restart this role instance